package com.zuiacsn.practice;

/*
* 大数加法
* */
public class demo02 {
    public static void main(String[] args) {
        String s = "123";
        String t = "234";
        String str = solve(s,t);
        System.out.println(str);


        int a = '1'-48;
        System.out.println(a);

    }
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     * 计算两个数之和
     * @param s string字符串 表示第一个整数
     * @param t string字符串 表示第二个整数
     * @return string字符串
     */

    public static String solve (String s, String t) {
        int sum1 = 0;
        int index1 = 0;
        while(index1<s.length()){
            int ge = s.charAt(index1)-48;
            sum1 = sum1*10+ge;
            index1++;
        }

        int sum2 = 0;
        int index2 = 0;
        while(index2<t.length()){
            int ge = t.charAt(index2)-48;
            sum2 = sum2*10+ge;
            index2++;
        }

        int sum = sum1+sum2;


        String str = "";
        while(sum!=0){
            int ge = sum%10;
            str = ge+str;
            sum/=10;
        }
        return str;
    }

}
